{extend name="template/base" /}
{block name="content"}
<div class="page-container">
    {include file="form" /}
        
     <div class="cl pd-5 bg-1 bk-gray">
     <div class="btn-group" style='float:left;'>
        {switch name="$Request.param.identity" }
            {case value="1"}
            <a class="btn radius" href="{:url('index',['identity'=>0])}" onclick="">技师</a>
            <a class="btn btn-primary radius" href="{:url('index',['identity'=>1])}" onclick="">客户</a>
            {/case}
            {case value="0"}
            <a class="btn btn-primary radius" href="{:url('index',['identity'=>0])}" onclick="">技师</a>
            <a class="btn radius" href="{:url('index',['identity'=>1])}" onclick="">客户</a>
            {/case}
            {default /}
            <a class="btn btn-primary radius" href="{:url('index',['identity'=>0])}" onclick="">技师</a>
            <a class="btn radius" href="{:url('index',['identity'=>1])}" onclick="">客户</a>
        {/switch}
        
     </div>
         <span class="r pt-5 pr-5">
            共有数据 ：<strong>{$count ?? '0'}</strong> 条
        </span>
    </div>
    <table class="table table-border table-bordered table-hover table-bg mt-20">
        {if condition="$Request.param.identity"}
        <thead>
        <tr class="text-c">
            {include file="k_th" /}
            <th width="180">操作</th>
        </tr>
        </thead>
        <tbody>
        {volist name="list" id="vo"}
        <tr class="text-c">
            {include file="k_td" /}
            <td class="f-14">
                <!-- <a href="{:url('edit',['id'=>$vo.id])}" class="label label-success radius" title="点击查看">查看</a> -->
                <!-- {tp:menu menu='sedit' /} -->
                {if condition="$vo.audit_status eq 3"}
                    
                {else/}
                    <a href="javascript:;" class='label label-success radius' onclick="andit(this,{$vo.id},3)">通过</a>
                    <a href="javascript:;" class='label label-danger radius' onclick="andit(this,{$vo.id},2)">不通过</a>
                {/if}
                {tp:menu menu='sdelete' /}
            </td>
        </tr>
        {/volist}
        </tbody>   
        {else/}
        <thead>
        <tr class="text-c">
            {include file="th" /}
            <th width="">操作</th>
        </tr>
        </thead>
        <tbody>
        {volist name="list" id="vo"}
        <tr class="text-c">
            {include file="td" /}
            <td class="f-14">
                <!-- <a href="{:url('edit',['id'=>$vo.id])}" class="label label-success radius" title="点击查看">查看</a> -->
                <!-- {tp:menu menu='sedit' /} -->
                <a href="javascript:;" class='label label-success radius' onclick="change_andit_status({$vo.id},3)">通过</a>
                <a href="javascript:;" class='label label-warning radius' onclick="change_andit_status({$vo.id},2)">不通过</a>
                {tp:menu menu='sdelete' /}
            </td>
        </tr>
        {/volist}
        </tbody>
        {/if}
    </table>
    <div class="page-bootstrap">{$page ?? ''}</div>
</div>
{/block}
{block name="script"}
<script>
    function andit(obj,id,andit_status){
        $.post('{:url(\'andit\')}',{'id':id,'audit_status':andit_status},function(r){
            if(r==1){
                window.location.reload();
            }else{
                layer.msg('请稍后再试');
            }
        })
    }
    function change_andit_status($id,status){
        $.post("{:url('change_andit_status')}",{'id':$id,'audit_status':status},function(r){
            if(r==1){
                layer.msg('提交成功,请稍后');
                setTimeout(function(){
                    location.reload();
                },2000);
            }else{
                layer.msg('提交失败，稍后请重试，或者联系开发')
            }
        });
    }
</script>
{/block}

